#!/usr/bin/php
<?php

require(dirname(__FILE__)."/../src_v2/classes/Token.php");


$uname   = 'piotr';
$pwd_md5 = md5('pass');

$token = Token::generate($uname, $pwd_md5, 1800);

$cookie_struct = array( 'token' => $token);
$cookie_json   = json_encode( $cookie_struct );


$_COOKIE['ParaSite_Auth'] = $cookie_json;

$url         = 'http://eb.dk';
$headline    = 'Denne avis lugter'; 
$category_id = '';

$request = array(
    'operation' => 'linkroll_post_link',
    'postback'  => 'blah',
    'param'     => array(
        'url'         => $url,
        'headline'    => $headline,
        'category_id' => $category_id,
        'preview_only' => 1
        )
);

$json = json_encode( $request );

$_POST['json']= $json;

require_once(dirname(__FILE__)."/../src_v2/classes/init.php");
require(dirname(__FILE__)."/../src_v2/remote.php");
echo "\n---end of response \n";

echo $PARAPARA->dblayer->latest_query, "\n";
echo $PARAPARA->dblayer->mysql_error, "\n";

?>